package com.op.teachingliteapp.common.api.smartpan;

import org.json.JSONObject;

import com.op.teachingliteapp.util.JsonUtils;

public class EntityBean {
	public final static String TYPE_FILE = "1";
	public final static String CTYPE_FOLDER = "0";
	public String entityID; // primary key for identity the item
	public String entityName; // The name of entity, like file or folder name
	public String authority; // The authority: wr-wr-wr like the linux authority
	public String entityType; // The type of entity, only have two type now:
								// 0-directory, 1 - file
	public String MD5Mark; // The MD5Mark only used for file type, for identitly
							// the file was or not the same one
	public String entityPoint; // The file Name in HDFS system, only used in
								// file type
	public String ownerID; // The ownerID ,
	public String fatherID; // The FatherID, when it equit with -1 that mean the
							// file or directory was at ROOT folder of owner.
	public String subNodeList; // the sub node list
	public String fileSize;
	private String condition="";

	/**
	 * 重写构造函数
	 */
	public EntityBean(JSONObject entityJsonObject) {
		this.entityName = JsonUtils.getJsonValue(entityJsonObject, "entityName");
		this.authority = JsonUtils.getJsonValue(entityJsonObject, "authority");
		this.entityType = JsonUtils.getJsonValue(entityJsonObject, "entityType");
		this.MD5Mark = JsonUtils.getJsonValue(entityJsonObject, "MD5Mark");
		this.entityPoint = JsonUtils.getJsonValue(entityJsonObject, "entityPoint");
		this.ownerID = JsonUtils.getJsonValue(entityJsonObject, "ownerID");
		this.fatherID = JsonUtils.getJsonValue(entityJsonObject, "fatherID");
		this.subNodeList = JsonUtils.getJsonValue(entityJsonObject, "fileSize");
		this.fileSize = JsonUtils.getJsonValue(entityJsonObject, "fileSize");
	}

	public String getEntityID() {
		return entityID;
	}

	public String getEntityName() {
		return entityName;
	}

	public String getAuthority() {
		return authority;
	}

	public String getEntityType() {
		return entityType;
	}

	public String getMD5Mark() {
		return MD5Mark;
	}

	public String getEntityPoint() {
		return entityPoint;
	}

	public String getOwnerID() {
		return ownerID;
	}

	public String getFatherID() {
		return fatherID;
	}

	public String getSubNodeList() {
		return subNodeList;
	}

	public String getFileSize() {
		return fileSize;
	}

	public String getCondition() {
		return condition;
	}

	public void setCondition(String condition) {
		this.condition = condition;
	}
}
